home *** CD-ROM | disk | FTP | other *** search
- unit Troppop;
- { TRopPop 1.0 (c) 1995 by Eyal Frank
- Tel Aviv
- Israel
- CIS : 100274,3376
- EMail frank-e@Trendline.co.il
-
- This is my first component , i realy want to get any feedback,
- So drop me an Email please.
-
- This is a simple component to display a modal Window with the cool shadow effect
- i'd get the basic idea from MSDN (i don't remember the actual program)
-
-
- TRopPop is FreeWare. You may use it freely at your own risk in any
- kind of environment. This component is not to be sold at any charge, and
- must be distributed along with the source code and this copyright header.
-
-
- property Brush
- TBrush , the Window BackGround.
-
- property Font : TFont
- The font of the text. Note that the window will Autosize to
- fit the size of the string .
-
- property Lines: TStrings
- Where u store the actual String(s)
-
- property TimeClose:Integer (ms)
- if u want that the window will auto close himself ,Set this property
- to the amount of mSecs. for example 1000 will close after one sec.
- if 0, then no auto close.
- property xPos,yPos :Integer
- the x and y coordinates of top left of win whn execute.
- if set to 0,then it will center.
-
- procedure Fire
- Like Execute. this proc will open the window and wait until user's
- any key down or click.(or auto close as above)
-
-
-
- }
-
-
- interface
-
- uses
- SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
- Forms, Dialogs,RopWin;
-
- type
- TRopWin = class(TComponent)
- private
- FormDlg:TRopInst;
- FBrush:TBrush;
- FFont:TFont;
- FLines:TStrings;
- FTimeClose:Integer;
- FXPos:Integer;
- FYPos:Integer;
- procedure SetLines(Value: TStrings);
- procedure SetFont(Value:TFont);
- procedure SetBrush(Value: TBrush);
- protected
- { Protected declarations }
- public
- constructor Create(AOwner: TComponent); override;
- destructor Destroy; override;
- procedure Fire;
- published
- property Brush:TBrush read FBrush write SetBrush;
- property Font:TFont read FFont write SetFont;
- property Lines:TStrings read FLines write SetLines;
- property TimeClose:Integer read FTimeClose write FTimeClose;
- property xPos: Integer read FXPos write FXPos;
- property yPos:Integer read FYPos write FYPos;
- end;
-
- procedure Register;
-
- implementation
- constructor TRopWin.Create(AOwner: TComponent);
- begin
- inherited Create(AOwner);
- FormDlg:=nil;
- FXPos:=0;
- FYPos:=0;
- FTimeClose:=0;
- FLines:=TStringList.Create;
- FBrush:=TBrush.Create;
- FFont:=TFont.Create;
- end;
- destructor TRopWin.Destroy;
- begin
- inherited Destroy;
- FLines.Free;
- FFont.Free;
- FBrush.Free;
- end;
- procedure TRopWin.Fire;
- begin
- if FLines.Count < 1 then
- begin
- MessageBox(Application.Handle,'The Lines is empty','Error',MB_OK);
- Exit;
- end;
- FormDlg:=TRopInst.Create(Application);
- try
- {FormDlg.Parent:=Self;}
- FormDlg.Font.Assign(FFont);
- FormDlg.formBrush.Assign(FBrush);
- FormDlg.sText.Assign(FLines);
- FormDlg.xPos:=FXPos;
- FormDlg.yPos:=FYPos;
- FormDlg.timerClose:=FTimeClose;
- FormDlg.DoInit;
- FormDlg.ShowModal;
- finally
- FormDlg.Free;
- FormDlg:=nil;
- end;
- end;
- procedure TRopWin.SetLines(Value: TStrings);
- begin
- FLines.Assign(Value);
- end;
- procedure TRopWin.SetFont(Value: TFont);
- begin
- FFont.Assign(Value);
- end;
- procedure TRopWin.SetBrush(Value: TBrush);
- begin
- FBrush.Assign(Value);
- end;
-
- procedure Register;
- begin
- RegisterComponents('Dialogs', [TRopWin]);
- end;
-
- end.
-